<html>
    <head><title>
            Upload File
        </title></head>
<body>

    <?php
if(isset($_POST['project'])){
  if ($_FILES["file"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
    }
  else
    {
      /*
    echo "Upload: " . $_FILES["file"]["name"] . "<br />";
    echo "Type: " . $_FILES["file"]["type"] . "<br />";
    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
    echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
       * 
       * 
       *
*/
      
      if($_REQUEST['base']==""){
          
      }else{
          $_REQUEST['base'].="/";
      }
    if (file_exists("../projects/".$_REQUEST['project']."/".$_REQUEST['base'] . $_FILES["file"]["name"]))
      {
      echo $_FILES["file"]["name"] . " already exists. ";
      }
    else
      {
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "../projects/".$_REQUEST['project']."/".$_REQUEST['base'] . $_FILES["file"]["name"]);
      @chmod("../projects/".$_REQUEST['project']."/".$_REQUEST['base'] . $_FILES["file"]["name"],0777);
      echo "<font color=green>Upload was successfull!</font><br/>";
      }
    }
}
?>
    
    
<form action="upload.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" /> 
<input type="hidden" name="project" value="<?php echo $_REQUEST['project'];?>"/>
<input type="hidden" name="base" value="<?php echo $_REQUEST['base'];?>"/>
<br />
<input type="submit" name="submit" value="Submit" />
</form>

</body>
</html>